package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbSellerMapper;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.TsellerService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DubboService
public class TsellerServiceimpl  implements TsellerService {

    @Autowired
    TbSellerMapper tsm;



    //查询全部
    @Override
    public List<TbSeller> getall() {
        return tsm.selectByExample(null);
    }


    //根据id查询
    @Override
    public TbSeller byid(String sellerId) {
        return tsm.selectByPrimaryKey(sellerId);
    }

    //审核通过
    @Override
    public int upTong(TbSeller tsr) {
        return tsm.updateByPrimaryKeySelective(tsr);
    }


    //注册增加
    @Override
    public int addsell(TbSeller tsr) {
        return tsm.insert(tsr);
    }


    //查询一条记录
    @Override
    public TbSeller byname(String username) {
        return tsm.byname(username);
    }
}
